1. Field of the Invention
The present invention relates to real-time transfer over a Peripheral Component Interconnect Express (PCIe) interface, and particularly to a method of reducing retry buffer capacity required when performing real-time transfer over a PCIe interface.
2. Description of the Prior Art
Please refer to FIG. 1, which is a diagram illustrating data transfer over a PCIe interface between a link device 100 and a link partner 101. When the link device 100 is a host, the link partner 101 is a corresponding device. When the link device 100 is a device, the link partner 101 is a corresponding host. The link device 100 comprises a retry buffer 110 and a packet transmission circuit 120. The packet transmission circuit 120 is utilized for transmitting packets. The retry buffer 110 is utilized for storing transmitted packets. For example, if the link device 100 wants to transmit a packet DP, and the packet DP is either a command packet DPCMD or a data packet DPDATA, the retry buffer 110 will store the packet DP, then transmit the packet DP to the packet transmission circuit 120 for the packet transmission circuit 120 to transmit the packet DP to the link partner 101. If the link partner 101 transmits an Acknowledged (ACK) command CMDACK corresponding to the packet DP, this means that the link partner 101 has already successfully received the packet DP. Thus, the link device 100 can obtain a packet sequence number corresponding to the packet DP according to the Acknowledged command CMDACK, and the link device 100 can control the retry buffer according to the packet sequence number SEQ for clearing the stored packet DP. If the link partner 101 transmits a retry command CMDNAK, such as a Not Acknowledged (NAK) command, it means the link partner 101 has not successfully received the packet DP. Thus, the link device 100 obtains the packet sequence number SEQ of the packet DP according to the retry command CMDNAK, and the link device 100 reads the packet DP stored in the retry buffer 110 according to the packet sequence number SEQ. In this way, the packet transmission circuit 120 can retransmit the packet DP to the link partner 101.
However, when the link device 100 and the link partner 101 perform real-time transfer across the PCIe interface, for example, when the link device 100 sends audio or video data by the packet DP1 (the packet DP1 is a data packet), if the link partner 101 has yet to receive the packet DP1 successfully, the link partner 101 sends a retry command CMDNAK1 corresponding to packet DP1 according to the description of FIG. 1, so that the link device 100 must retransmit the packet DP1. Even if the packet DP1 is a data packet DPDATA for transmitting audio or video data, the link device 100 resends the packet DP1 once according to the retry command CMDNAK1. When the link device 100 and the link partner 101 transmit data over the PCIe interface for transmitting audio or video, every data packet DPDATA must first be stored in the retry buffer 110, then transmitted by the packet transmission circuit 120 to the link partner 101. The retry buffer 110 must have sufficient capacity for storing packets (command packets DATACMD or data packets DATADATA), so that the link device 100 may transmit packets continuously to speed up real-time transfer. Because command packet size is defined in the PCIe specification to be 64-72 bytes, and data packet size is defined as 72-4096 bytes, if the retry buffer 110 is to be designed to buffer M data packets DPDATA, the retry buffer 110 must have capacity of 4096×M bytes. Thus, cost of the link device 100 is increased greatly by the high-capacity retry buffer 110, which is an inconvenience to a user thereof.